package com.bjpowernode.services;
import com.bjpowernode.beans.User;
import com.bjpowernode.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;



//Spring中@Scope注解意味着，Spring管理的bean如何实例化
// value="singleton"单例，仅有一个对象【默认】
// value="prototype"原型，每次从Spring里面拿出来都会new
// value="request",请求作用域，每次请求，只要请求对象不一样，则会new
// value="session",session作用域，只要sessionID不一致或者没有，则会new
@Service
public class UserServicesImp implements UserServices{
    @Autowired
    UserMapper userMapper;

    @Override
    public User login(String id, String password) {
        return userMapper.getByIDAndPassword(id,password);
    }
}
